<!--
 * @Author: HeAo
 * @Date: 2021-10-08 11:17:47
 * @LastEditTime: 2021-10-08 11:51:27
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2105\3-2-Vue\day01\5-条件渲染.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
</head>

<body>
  <div id="app">
    <div v-if="isLogin">
      <h1>欢迎你，登录成功</h1>
    </div>
    <div v-else>
      <h1>请先登录</h1>
    </div>
    <div>
      <button v-if="isLogin" @click="isLogin = false">退出</button>
      <button v-else @click="isLogin = true">登录</button>
    </div>
    <div>
      <button v-show="false">退出</button>
      <button v-show="true">登录</button>
    </div>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        isLogin: false
      },
      methods: {},
      created() { }
    })
  </script>
</body>

</html>